import CommonApi from './common'

// 养护任务单
class MaintenanceTaskApi extends CommonApi {
    constructor() {
        super()
        this.scope = '/maint/assignment'
    }

    // 接受任务
    acceptTask(data) {
        const path = this.resolvePath('/acceptAssignment')
        return this.post(path, data)
    }
    // 拒绝任务
    rejectTask(data) {
        const path = this.resolvePath('/refuseAssignment')
        return this.post(path, data)
    }
    // 完工核实
    completionVerification(data) {
        const path = this.resolvePath('/completeVerify')
        return this.post(path, data)
    }
    // 填写处理结果
    editProcessingResult(data) {
        const path = this.resolvePath('/processResult')
        return this.post(path, data)
    }
    // 审批
    approve(data) {
        const path = this.resolvePath('/approval')
        return this.post(path, data)
    }
    // 批量提交审批
    batchSubmitApproval(data) {
        const path = this.resolvePath('/submitApproval')
        return this.post(path, data)
    }
    // 批量撤销审批
    batchrRevocationApproval(data) {
        const path = this.resolvePath('/cancelApproval')
        return this.post(path, data)
    }
    // 完工核实结果列表
    getCompletionVerificationList(data) {
        const path = this.resolvePath('/completeVerifylist')
        return this.post(path, data)
    }
    // 处理结果列表
    getProcessingResultList(data) {
        const path = this.resolvePath('/processResultlist')
        return this.post(path, data)
    }
    // 验证养护任务单名称唯一性
    validTaskName(data) {
        const path = this.resolvePath('/nameCheck')
        return this.post(path, data)
    }
    // 查看拒绝原因
    viewRejectReason(data) {
        const path = this.resolvePath('/refuseRemark')
        return this.post(path, data)
    }
    // 获取待办列表
    getPeddingList(data) {
        const path = this.resolvePath('/getWaitProcessList')
        return this.post(path, data)
    }
}

export default MaintenanceTaskApi
